package com.bt.lms.ui.action.teacher.basic.info;

import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;

/**
 * 新增工作简历信息事件
 */
public class JobResumeAddBtn implements EventHandler {

    private VBox jobInfoVBox;
    private Integer width = 1280;
    private Integer height = 900;

    public JobResumeAddBtn(VBox jobInfoVBox) {
        this.jobInfoVBox = jobInfoVBox;
    }


    @Override
    public void handle(Event event) {
        //保存按钮盒子
        HBox saveHBox = new HBox();
        saveHBox.setSpacing(20);
        saveHBox.setAlignment(Pos.CENTER_RIGHT);
        saveHBox.setPadding(new Insets(15,15,15,15));
        double saveHBoxHeight=height*0.01;
        saveHBox.setMaxHeight(saveHBoxHeight);
        saveHBox.setPrefWidth(width);
        Button savaBtn = new Button("保存");
        Button cancelBtn = new Button("取消");
        saveHBox.getChildren().addAll(savaBtn,cancelBtn);
        jobInfoVBox.getChildren().add(saveHBox);

        //工作时间盒子
        HBox timeHBox = new HBox();
        timeHBox.setPadding(new Insets(0,0,0,30));
        timeHBox.setSpacing(20);
        double timeHBoxHeight=height*0.05;
        timeHBox.setPrefHeight(timeHBoxHeight);
        timeHBox.setPrefWidth(width);
        Label timeLb = new Label("工作时间");
        timeLb.setPrefWidth(100);
        DatePicker startTimeDP = new DatePicker();
        Label label = new Label("至");
        DatePicker stopTimeDP = new DatePicker();
        timeHBox.getChildren().addAll(timeLb,startTimeDP,label,stopTimeDP);
        jobInfoVBox.getChildren().add(timeHBox);
        //工作单位盒子
        HBox unitHBox = new HBox();
        unitHBox.setPadding(new Insets(0,0,0,30));
        unitHBox.setSpacing(20);
        double unitHBoxHeight=height*0.05;
        unitHBox.setPrefHeight(unitHBoxHeight);
        unitHBox.setPrefWidth(width);
        Label unitLb = new Label("工作单位");
        unitLb.setPrefWidth(100);
        TextField unitTF = new TextField();
        unitHBox.getChildren().addAll(unitLb,unitTF);
        jobInfoVBox.getChildren().add(unitHBox);
        //工作证明人盒子
        HBox referencesHBox = new HBox();
        referencesHBox.setPadding(new Insets(0,0,0,30));
        referencesHBox.setSpacing(20);
        double referencesHBoxHeight=height*0.05;
        referencesHBox.setPrefHeight(referencesHBoxHeight);
        referencesHBox.setPrefWidth(width);
        Label referencesLb = new Label("工作证明人");
        referencesLb.setPrefWidth(100);
        TextField referencesTF = new TextField();
        referencesHBox.getChildren().addAll(referencesLb,referencesTF);
        jobInfoVBox.getChildren().add(referencesHBox);
        //所任党政职务盒子
        HBox occupationHBoxHBox = new HBox();
        occupationHBoxHBox.setPadding(new Insets(0,0,0,30));
        occupationHBoxHBox.setSpacing(20);
        double occupationHBoxHBoxHeight=height*0.05;
        occupationHBoxHBox.setPrefHeight(occupationHBoxHBoxHeight);
        occupationHBoxHBox.setPrefWidth(width);
        Label occupationLb = new Label("所任党政职务");
        occupationLb.setPrefWidth(100);
        TextField specialtyTF = new TextField();
        occupationHBoxHBox.getChildren().addAll(occupationLb,specialtyTF);
        jobInfoVBox.getChildren().add(occupationHBoxHBox);
        //所任专业技术职务盒子
        HBox dutyHBox = new HBox();
        dutyHBox.setPadding(new Insets(0,0,0,30));
        dutyHBox.setSpacing(20);
        double dutyHBoxHeight=height*0.05;
        dutyHBox.setPrefHeight(dutyHBoxHeight);
        dutyHBox.setPrefWidth(width);
        Label dutyLb = new Label("所任专业技术职务");
        dutyLb.setPrefWidth(100);
        TextField dutyTF = new TextField();
        dutyHBox.getChildren().addAll(dutyLb,dutyTF);
        jobInfoVBox.getChildren().add(dutyHBox);
        //工作内容盒子
        HBox contentHBox = new HBox();
        contentHBox.setPadding(new Insets(0,0,0,30));
        contentHBox.setSpacing(20);
        double contentHBoxHeight=height*0.05;
        contentHBox.setPrefHeight(contentHBoxHeight);
        contentHBox.setPrefWidth(width);
        Label contentLb = new Label("工作内容");
        contentLb.setPrefWidth(100);
        TextArea contentTa = new TextArea();
        contentHBox.getChildren().addAll(contentLb,contentTa);
        jobInfoVBox.getChildren().add(contentHBox);
        //工作简历备注
        HBox notesHBox = new HBox();
        notesHBox.setPadding(new Insets(0,0,0,30));
        notesHBox.setSpacing(20);
        double notesHBoxHeight=height*0.05;
        notesHBox.setPrefHeight(notesHBoxHeight);
        notesHBox.setPrefWidth(width);
        Label notesLb = new Label("工作简历备注");
        notesLb.setPrefWidth(100);
        TextArea notesTa = new TextArea();
        notesHBox.getChildren().addAll(notesLb,notesTa);
        jobInfoVBox.getChildren().add(notesHBox);



    }
}
